#include <iostream>
#include "Protocol.hpp"

using namespace std;

int main()
{
    Request req(10,20,'+');
    string message;
    req.Serialize(message);
    cout<<"Request: " << message << endl;
    if (Encode(message))
    {
        cout << "Encode success!:"<<message << endl;  
    }

    string dmessage;
    if(Decode(message, &dmessage))
    {
        cout << "Decode success!dmessage:"<<dmessage <<"message:"<<message.c_str() << endl;
    }

    req.Deserialize(dmessage);
    cout<<"Request: " << req.GetX() << " " << req.GetY() << " " << req.GetOper() << endl;


    return 0;
}